//package com.cowain.monitor.controller;
//
//import com.cowain.monitor.datasources.annotation.OperLog;
//import com.cowain.monitor.entity.ErpShipEntity;
//import com.cowain.monitor.service.PmsShipmentStatusService;
//import com.cowain.monitor.utils.R;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
///**
// * PMS ehr-backend
// *
// * @Classname PmsShipmentStatusController
// * @Description TODO
// * @Date 2020-07-28 17:46
// * @Created 沈科举
// */
//@Slf4j
//@RestController
//@RequestMapping("/erp/pms")
//public class PmsShipmentStatusController {
//    @Autowired
//    private PmsShipmentStatusService pmsShipmentStatusService;
////    @Scheduled(cron = "0/5 * * * * ?")
//    @GetMapping("/pushErpShipData")
////    @OperLog(operModul = "出货信息模块", operType = "", operDesc = "出货信息和状态同步")
//    public void syncErpShipData() {
//        List<ErpShipEntity> erpShipEntityList = pmsShipmentStatusService.findErpShipEntityByIsdel();
//        if (null != erpShipEntityList && 0 != erpShipEntityList.size()) {
//            int result = pmsShipmentStatusService.addPmsShipmentStatus(erpShipEntityList);
//            if (0 < result) {
//                result = pmsShipmentStatusService.addPmsDeliveryNotice(erpShipEntityList);
//                if (0 < result) {
//                    result = pmsShipmentStatusService.updateErpShipIsdel(erpShipEntityList);
//                    if (0 < result) {
//                        System.out.println("出货消息和状态同步成功");
//                        syncErpShipData();
//                        return ;
//                    }
//
//                }
//
//            }
//            System.out.println("出货消息和状态同步失败");
//            return ;
//        }
//        System.out.println("出货消息和状态没有需要同步数据");
//        return;
//    }
//
//
//}
